SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO

CREATE procedure dbo.DnnProduct_GetLink

@ItemId   int,
@ModuleId int

as

select  DnnProduct_Links.ItemId,
	DnnProduct_Links.ModuleId,
	DnnProduct_Links.Title,
	DnnProduct_Links.URL,
        DnnProduct_Links.ViewOrder,
        DnnProduct_Links.Description,
        DnnProduct_Links.CreatedByUser,
        DnnProduct_Links.CreatedDate,
        DnnProduct_UrlTracking.TrackClicks,
        DnnProduct_UrlTracking.NewWindow
from    DnnProduct_Links
left outer join DnnProduct_UrlTracking on DnnProduct_Links.URL = DnnProduct_UrlTracking.Url and DnnProduct_UrlTracking.ModuleId = @ModuleID 
where  DnnProduct_Links.ItemId = @ItemId
and    DnnProduct_Links.ModuleId = @ModuleId

GO
